#ifndef __WORKER_THREAD_HPP__
#define __WORKER_THREAD_HPP__
#include <mutex>
#include <list>
class thread_task;
class worker_thread
{
private:
    /* data */
    int m_notify_send_fd = 0;
    int m_t_id;
    struct event_base* m_base;
    std::list<thread_task*> m_tasks;
    std::mutex m_tasks_mutex;

public:
    void setup();  
    void start();
    void notify(int fd,short ev);
    void add_task(thread_task* tasks);
    void activate();
    static void event_funcb(int fd, short, void *);

public:
    void set_pthread_id(int pthread_id);
    int get_pthread_id();
    void thread_func();
    
    worker_thread(/* args */);
    ~worker_thread();
};

#endif